package com.album.task;


import android.content.Context;
import android.util.Log;

import com.album.http.HttpRequest;
import com.album.utils.Config;
/**
 * 获取用户相册空间信息
 * Rome
 */
public class GetAlbumInfoTask extends Task{
	private String TAG = "HttpRspThread";
	private Context ctx;
	private ICallBack callBack;
	private String username;
	
	public GetAlbumInfoTask(Context ctx,String username,ICallBack resTask){
		this.ctx = ctx;
		this.callBack = resTask;
		this.username = username;
	}
	public String setRequest(){
		String strUrl =Config.TyHttp + Config.TyUserHttp+
		"album?passport="+username;
		
		Log.d("url", strUrl);
		
//		System.out.println(strUrl);

		String jsonString = HttpRequest.sendDataPost(ctx,strUrl, null,callBack);
		return jsonString;
	}
	@Override
	public void doTask(Task thread){
		Thread t = new Thread(thread);
		t.start();
	}
	@Override
	public void run() {
		//返回数据
		try {
			String strRsp = setRequest();
			callBack.CallBack(strRsp);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

